<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>

<style type="text/css">
	
	form div{
		margin-top: 20px;
	}
	.select{
		
	}
}
</style>
<script type="text/javascript" src="js/jquery-1.12.4.js"></script>
<script type="text/javascript">	
	$(function(){
		
		$("#oneselect").change(function(){
			$.getJSON("twoAll",{parentId:$(this).val()},function(data){
				
				$("#towselect").html("");
				$.each(data,function(i,item){	
					
					$("<option value='"+item["id"]+"'>"+item["categoryName"]+"</option>").appendTo("#towselect");
					
				})
			})
		})
		$("#towselect").change(function(){
			
			$.getJSON("threeAll",{parentId:$(this).val()},function(data){
				
				$("#threeselect").html("");
				$.each(data,function(i,item){	
					
					$("<option value='"+item["id"]+"'>"+item["categoryName"]+"</option>").appendTo("#threeselect");
					
				})
			})
		})
		
	})
</script>

</head>
<body>
	<div class="select" style="width: 400px;height:1000px;margin-left: 350px;margin-top: -300px">
	<form action="doaddandupdate" enctype="multipart/form-data" method="post" >
		<div class="input-group" >
			<span class="input-group-addon">软件名称*</span> <input type="text" name="softwareName"
				class="form-control" placeholder="请输入软件名称">
		</div>
		<div class="input-group" >
			<span class="input-group-addon">APK名称*</span> <input type="text" name="aPKName"
				class="form-control" placeholder="请输入APK名称">
		</div>
		<div class="input-group" >
			<span class="input-group-addon">支持ROM*</span> <input type="text" name="supportROM"
				class="form-control" placeholder="请输入支持的ROM">
		</div>
		<div class="input-group" >
			<span class="input-group-addon">界面语言*</span> <input type="text" name="interfaceLanguage"
				class="form-control" placeholder="请输入软件支持的界面语言">
		</div>
		<div class="input-group">
			<span class="input-group-addon">软件大小*</span> <input type="text" name="softwareSize"
				class="form-control" placeholder="请输入软件大小，单位为Mb">
		</div>
		<div class="input-group">
			<span class="input-group-addon">下载次数*</span> <input type="text" name="downloads"
				class="form-control" placeholder="请输入下载次数">
		</div>
		<div class="input-group">
			<span class="input-group-addon">所属平台*</span><select name="flatformId" class="form-control"><option value="0">请选择</option>
			
			
		<c:forEach items="${flatformList}" var="temp">
			<option value="${temp.valueId}">
				${temp.valueName}	
			</option>
		</c:forEach></select>
		</div>
		<div class="input-group">
			<span class="input-group-addon">一级分类*</span> <select name="categoryLevel1" class="form-control"  id="oneselect" ><option value="0">请选择</option>
			<c:forEach var="c" items="${listone }" varStatus="i">
				<option value="${ c.id}" selected="selected">${c.categoryName}</option>	
			</c:forEach>
			</select>
		</div>
		<div class="input-group">
			<span class="input-group-addon">二级分类*</span> <select name="categoryLevel2" class="form-control" id="towselect">
				</select>
		</div>
		<div class="input-group">
			<span class="input-group-addon">三级分类*</span><select name="categoryLevel3" class="form-control" id="threeselect">
			</select>
		</div>
		<div class="input-group">
			<span class="input-group-addon">APP状态*</span>待审核
		</div>
		<div class="input-group">
			<span class="input-group-addon">应用简介*</span> <textarea class="form-control" name="appInfo"
			 rows="3"></textarea>
		</div>
		<div class="input-group">
			<span class="input-group-addon">LOGO图片*</span> <input type="file" name="logoPicPath"
				class="form-control" placeholder="Username">
		</div>
		<div>
		<input type="submit" class="btn btn-default" value="保存" style="margin-left: 200px">
		<a href="home"><input type="button" class="btn btn-primary" value="返回"></a>
		</div>
	</form>
	</div>
</body>
</html>